package com.ruoyi.faceplus.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.faceplus.domain.UserFace;
import com.ruoyi.faceplus.mapper.UserFaceMapper;
import com.ruoyi.faceplus.service.IUserFaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 人脸识别库Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-17
 */
@Service
public class UserFaceServiceImpl implements IUserFaceService
{
    @Autowired
    private UserFaceMapper UserFaceMapper;

    /**
     * 查询人脸识别库
     * 
     * @param id 人脸识别库主键
     * @return 人脸识别库
     */
    @Override
    public UserFace selectUserFaceById(Long id)
    {
        return UserFaceMapper.selectUserFaceById(id);
    }

    @Override
    public UserFace selectUserFace(UserFace UserFace)
    {
        return UserFaceMapper.selectUserFace(UserFace);
    }

    /**
     * 查询人脸识别库列表
     * 
     * @param UserFace 人脸识别库
     * @return 人脸识别库
     */
    @Override
    public List<UserFace> selectUserFaceList(UserFace UserFace)
    {
        return UserFaceMapper.selectUserFaceList(UserFace);
    }

    /**
     * 新增人脸识别库
     * 
     * @param UserFace 人脸识别库
     * @return 结果
     */
    @Override
    public int insertUserFace(UserFace UserFace)
    {
        UserFace.setCreateTime(DateUtils.getNowDate());
        return UserFaceMapper.insertUserFace(UserFace);
    }

    /**
     * 修改人脸识别库
     * 
     * @param UserFace 人脸识别库
     * @return 结果
     */
    @Override
    public int updateUserFace(UserFace UserFace)
    {
        UserFace.setUpdateTime(DateUtils.getNowDate());
        return UserFaceMapper.updateUserFace(UserFace);
    }

    /**
     * 批量删除人脸识别库
     * 
     * @param ids 需要删除的人脸识别库主键
     * @return 结果
     */
    @Override
    public int deleteUserFaceByIds(Long[] ids)
    {
        return UserFaceMapper.deleteUserFaceByIds(ids);
    }

    /**
     * 删除人脸识别库信息
     * 
     * @param id 人脸识别库主键
     * @return 结果
     */
    @Override
    public int deleteUserFaceById(Long id)
    {
        return UserFaceMapper.deleteUserFaceById(id);
    }
}
